<template>
  <div>
    <div>
      <el-button @click="mocktianchong">mock填充</el-button>
    </div>
    <el-form :model="formData" :inline="true" label-width="auto">
      
      <el-form-item
        label="id"
        prop="id"
        data-type="bigint"
      >
        
        <el-input
          placeholder="id"
          style="width: 120px"
          v-model="formData['id']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="corp_id"
        prop="corp_id"
        data-type="bigint"
      >
        
        <el-input
          placeholder="corp_id"
          style="width: 120px"
          v-model="formData['corp_id']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="talents_id"
        prop="talents_id"
        data-type="bigint"
      >
        
        <el-input
          placeholder="talents_id"
          style="width: 120px"
          v-model="formData['talents_id']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="expend_type"
        prop="expend_type"
        data-type="tinyint"
      >
        
        <el-input
          placeholder="expend_type"
          style="width: 120px"
          v-model="formData['expend_type']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="attach_url"
        prop="attach_url"
        data-type="varchar(255)"
      >
        
        <el-input
          placeholder="attach_url"
          style="width: 120px"
          v-model="formData['attach_url']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="order_num"
        prop="order_num"
        data-type="int"
      >
        
        <el-input
          placeholder="order_num"
          style="width: 120px"
          v-model="formData['order_num']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="state"
        prop="state"
        data-type="tinyint"
      >
        
        <el-input
          placeholder="state"
          style="width: 120px"
          v-model="formData['state']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="default_type"
        prop="default_type"
        data-type="tinyint"
      >
        
        <el-input
          placeholder="default_type"
          style="width: 120px"
          v-model="formData['default_type']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="tenant_type"
        prop="tenant_type"
        data-type="tinyint"
      >
        
        <el-input
          placeholder="tenant_type"
          style="width: 120px"
          v-model="formData['tenant_type']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="tenant_id"
        prop="tenant_id"
        data-type="bigint"
      >
        
        <el-input
          placeholder="tenant_id"
          style="width: 120px"
          v-model="formData['tenant_id']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="del_state"
        prop="del_state"
        data-type="tinyint"
      >
        
        <el-input
          placeholder="del_state"
          style="width: 120px"
          v-model="formData['del_state']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="add_user"
        prop="add_user"
        data-type="varchar(50)"
      >
        
        <el-input
          placeholder="add_user"
          style="width: 120px"
          v-model="formData['add_user']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="add_user_id"
        prop="add_user_id"
        data-type="bigint"
      >
        
        <el-input
          placeholder="add_user_id"
          style="width: 120px"
          v-model="formData['add_user_id']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="add_time"
        prop="add_time"
        data-type="datetime"
      >
        
        <erp-date-picker
          placeholder="add_time"
          style="width: 120px"
          v-model="formData['add_time']"
          value-format="YYYY-MM-DD HH:mm:ss"
          format="YYYY-MM-DD HH:mm:ss"
        ></erp-date-picker>
        
      </el-form-item>
      
      <el-form-item
        label="edit_user"
        prop="edit_user"
        data-type="varchar(50)"
      >
        
        <el-input
          placeholder="edit_user"
          style="width: 120px"
          v-model="formData['edit_user']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="edit_user_id"
        prop="edit_user_id"
        data-type="bigint"
      >
        
        <el-input
          placeholder="edit_user_id"
          style="width: 120px"
          v-model="formData['edit_user_id']"
        ></el-input>
        
      </el-form-item>
      
      <el-form-item
        label="last_edit_time"
        prop="last_edit_time"
        data-type="datetime"
      >
        
        <erp-date-picker
          placeholder="last_edit_time"
          style="width: 120px"
          v-model="formData['last_edit_time']"
          value-format="YYYY-MM-DD HH:mm:ss"
          format="YYYY-MM-DD HH:mm:ss"
        ></erp-date-picker>
        
      </el-form-item>
      
      <el-form-item
        label="server_number"
        prop="server_number"
        data-type="smallint"
      >
        
        <el-input
          placeholder="server_number"
          style="width: 120px"
          v-model="formData['server_number']"
        ></el-input>
        
      </el-form-item>
      
    </el-form>
  </div>
</template>
<script>
  import { dateFormatYYYYMMDDHHmmss, isIOS } from '@/utils'
  import { alertWithPaylod } from '@/utils/alertUtils';

import axios from "axios";
export default {
  data() {
    return {
      formData: {},
    };
  },
  methods: {
    mocktianchong,
    initByDialog(_data) {
      if (_data && _data.id) {

        
           
        
           
        
           
        
           
        
           
        
           
        
           
        
           
        
           
        
           
        
           
        
           
        
           
        
           
            _data['add_time']=dateFormatYYYYMMDDHHmmss(_data['add_time'])
           
        
           
        
           
        
           
            _data['last_edit_time']=dateFormatYYYYMMDDHHmmss(_data['last_edit_time'])
           
        
           
        


        this.formData = _data;
      }
    },
    async submitByDialog() {
      var params = this.formData;
      var resylt = await axios
        .post("/api/erp_hrm_rival_corp_attach/apis", {
          _name: "addorupdate",
          ...params,
        })
        .then((res) => res.data);
      console.log("resylt :", resylt);
      alertWithPaylod(resylt)

      return resylt;
    },
  },
};
</script>
